<?php

namespace Sffi\ElementPlus\ElList;

class ElSwitch extends Column
{
    protected bool $isSwitch=true;
    /**
     * @var int|string $switchOpen
     */
    protected $switchOpen;
    /**
     * @var int|string $switchClose
     */
    protected $switchClose;

    protected string $switchOpenText;
    protected string $switchCloseText;
    protected string $switchOpenColor = '';
    protected string $switchCloseColor = '';

    /**
     * @param $title
     * @param $key
     * @param $switchOpen
     * @param $switchClose
     * @param $switchOpenText
     * @param $switchCloseText
     */
    public function __construct($title, $key, $dataKey, $switchOpen, $switchClose, $switchOpenText='开启', $switchCloseText='关闭')
    {
        parent::__construct($title, $key, $dataKey);
        $this->switchOpen = $switchOpen;
        $this->switchClose = $switchClose;
        $this->switchOpenText = $switchOpenText;
        $this->switchCloseText = $switchCloseText;
    }


    /**
     * @return int|string
     */
    public function getSwitchOpen()
    {
        return $this->switchOpen;
    }

    /**
     * @param int|string $switchOpen
     */
    public function setSwitchOpen($switchOpen): self
    {
        $this->switchOpen = $switchOpen;
        return $this;
    }

    /**
     * @return int|string
     */
    public function getSwitchClose()
    {
        return $this->switchClose;
    }

    /**
     * @param int|string $switchClose
     */
    public function setSwitchClose($switchClose): self
    {
        $this->switchClose = $switchClose;
        return $this;
    }

    /**
     * @return string
     */
    public function getSwitchOpenText(): string
    {
        return $this->switchOpenText;
    }

    /**
     * @param string $switchOpenText
     */
    public function setSwitchOpenText(string $switchOpenText): self
    {
        $this->switchOpenText = $switchOpenText;
        return $this;
    }

    /**
     * @return string
     */
    public function getSwitchCloseText(): string
    {
        return $this->switchCloseText;
    }

    /**
     * @param string $switchCloseText
     */
    public function setSwitchCloseText(string $switchCloseText): self
    {
        $this->switchCloseText = $switchCloseText;
        return $this;
    }

    /**
     * @return string
     */
    public function getSwitchOpenColor(): string
    {
        return $this->switchOpenColor;
    }

    /**
     * @param string $switchOpenColor
     */
    public function setSwitchOpenColor(string $switchOpenColor): self
    {
        $this->switchOpenColor = $switchOpenColor;
        return $this;
    }

    /**
     * @return string
     */
    public function getSwitchCloseColor(): string
    {
        return $this->switchCloseColor;
    }

    /**
     * @param string $switchCloseColor
     */
    public function setSwitchCloseColor(string $switchCloseColor): self
    {
        $this->switchCloseColor = $switchCloseColor;
        return $this;
    }
}